package com.ruoyi.workSafetyStandardization.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.workSafetyStandardization.mapper.GradeMajorRuleMapper;
import com.ruoyi.workSafetyStandardization.domain.GradeMajorRule;
import com.ruoyi.workSafetyStandardization.service.IGradeMajorRuleService;

/**
 * 评分-评级专业得分规则Service业务层处理
 *
 * @author pengjie
 * @date 2023-12-15
 */
@Service
public class GradeMajorRuleServiceImpl implements IGradeMajorRuleService
{
    @Autowired
    private GradeMajorRuleMapper gradeMajorRuleMapper;

    /**
     * 查询评分-评级专业得分规则
     *
     * @param gradeMajorRuleId 评分-评级专业得分规则主键
     * @return 评分-评级专业得分规则
     */
    @Override
    public GradeMajorRule selectGradeMajorRuleByGradeMajorRuleId(String gradeMajorRuleId)
    {
        return gradeMajorRuleMapper.selectGradeMajorRuleByGradeMajorRuleId(gradeMajorRuleId);
    }

    /**
     * 查询评分-评级专业得分规则列表
     *
     * @param gradeMajorRule 评分-评级专业得分规则
     * @return 评分-评级专业得分规则
     */
    @Override
    public List<GradeMajorRule> selectGradeMajorRuleList(GradeMajorRule gradeMajorRule)
    {
        return gradeMajorRuleMapper.selectGradeMajorRuleList(gradeMajorRule);
    }

    /**
     * 新增评分-评级专业得分规则
     *
     * @param gradeMajorRule 评分-评级专业得分规则
     * @return 结果
     */
    @Override
    public int insertGradeMajorRule(GradeMajorRule gradeMajorRule)
    {
        gradeMajorRule.setCreateByName(SecurityUtils.getUsername());
        gradeMajorRule.setCreateAt(new Date());
        gradeMajorRule.setCreateBy(SecurityUtils.getUserId().toString());
        return gradeMajorRuleMapper.insertGradeMajorRule(gradeMajorRule);
    }

    /**
     * 修改评分-评级专业得分规则
     *
     * @param gradeMajorRule 评分-评级专业得分规则
     * @return 结果
     */
    @Override
    public int updateGradeMajorRule(GradeMajorRule gradeMajorRule)
    {
        return gradeMajorRuleMapper.updateGradeMajorRule(gradeMajorRule);
    }

    /**
     * 批量删除评分-评级专业得分规则
     *
     * @param gradeMajorRuleIds 需要删除的评分-评级专业得分规则主键
     * @return 结果
     */
    @Override
    public int deleteGradeMajorRuleByGradeMajorRuleIds(String[] gradeMajorRuleIds)
    {
        return gradeMajorRuleMapper.deleteGradeMajorRuleByGradeMajorRuleIds(gradeMajorRuleIds);
    }

    /**
     * 删除评分-评级专业得分规则信息
     *
     * @param gradeMajorRuleId 评分-评级专业得分规则主键
     * @return 结果
     */
    @Override
    public int deleteGradeMajorRuleByGradeMajorRuleId(String gradeMajorRuleId)
    {
        return gradeMajorRuleMapper.deleteGradeMajorRuleByGradeMajorRuleId(gradeMajorRuleId);
    }
}
